<form class="form-inline" method="get">
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="id" value="{$param.id|default=''}"
                   placeholder="订单编号">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <span></span><input class="form-control" name="userinfo" value="{$param.userinfo|default=''}"
                   placeholder="购买人：用户名|手机号">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            {include file="public/dateRangePicker" picker-name="time_range"/}
        </div>
    </div>
    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <select class="form-control" name="peiduistatus" id="match_status">
                <option value="">全部</option>
                <option value="1" {if isset($param.peiduistatus) && $param.peiduistatus eq 1}selected{/if}>未匹配</option>
                <option value="2" {if isset($param.peiduistatus) && $param.peiduistatus eq 2}selected{/if}>已匹配</option>
            </select>
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                筛选
            </button>
        </div>
    </div>
</form>

<hr>

<table class="table table-striped table-bordered">
    <thead>
    <tr>
        <td>编号ID</td>
        <td>购买人</td>
        <td>产品信息</td>
        <td>合约收益</td>
        <td>本次消费</td>
        <td>收益详情</td>
        <td>配对状态</td>
        <td>购买时间</td>
        <td>配对人</td>
        <td>配对订单id</td>
        <td>支付信息</td>
        <td>可卖出时间</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>
            <p><label class="label label-danger">账号：{$item.b_username}</label></p>
            <p><label class="label label-success">手机号：{$item.b_selfphone}</label></p>
        </td>
        <td>
            <p><label class="label label-danger">产品id：{$item.productid}</label></p>
            <p><label class="label label-success">产品名称：{$item.title}</label></p>
        </td>
        <td>
            {$item.daynum}天/{$item.earnpercent}%
        </td>
        <td>
            {$item.price}
        </td>
        <td>
            <p><label class="label label-danger">预计收益：{$item.dayaddprice}</label></p>
            <p><label class="label label-success">预计卖出可得：{$item.basicprice}</label></p>
        </td>
        <td>
            {if $item.peiduistatus eq 1}
            <p><label class="label label-danger">未配对</label></p>
            {else}
            <p><label class="label label-success">已配对</label></p>
            {/if}
        </td>
        <td>
            {:date("Y-m-d H:i:s", $item.ctime)}
        </td>
        <td>
            {if !empty($item.m_username)}
            <p><label class="label label-danger">账号：{$item.m_username}</label></p>
            <p><label class="label label-success">手机号：{$item.m_selfphone}</label></p>
            {/if}
        </td>
        <td>
            {if $item.match_oid eq 0}

            {else}
            {$item.match_oid}
            {/if}
        </td>
        <td>
            {if $item.paystatus eq 0}
            <p><label class="label label-danger">未支付</label></p>
            {elseif $item.paystatus eq 1}
            <p><label class="label label-success">已支付</label></p>
            {elseif $item.paystatus eq 2}
            <p><label class="label label-success">已完成</label></p>
            {/if}
        </td>
        <td>
            {:date("Y-m-d H:i:s", $item.cansaletime)}
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$list->render()}
    </div>
</div>

<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>